package com.genesis.yunnanji.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.genesis.yunnanji.R;
import com.genesis.yunnanji.bean.DiZhouJingDianBean;
import com.genesis.yunnanji.config.GenesisApiConfig;

import java.util.List;

/**
 * 创建日期：2018/11/1 0001
 * 作者：Kite
 * 描述：
 */
public class DiZhouJingDianAdapter extends BaseQuickAdapter<DiZhouJingDianBean.ResultBean.ListBean, BaseViewHolder> {

    private Context context;

    public DiZhouJingDianAdapter(Context context, @Nullable List<DiZhouJingDianBean.ResultBean.ListBean> data) {
        super(R.layout.item_di_zhou_list, data);
        this.context = context;
    }

    @Override
    protected void convert(final BaseViewHolder helper, DiZhouJingDianBean.ResultBean.ListBean item) {
        Glide.with(context).load(GenesisApiConfig.PIC_HOST + item.getCover_img()).into((ImageView) helper.getView(R.id.ivImg));
        helper.setText(R.id.tvTitle, item.getTitle());
        helper.setText(R.id.tvAddress, item.getAddr());
        helper.setText(R.id.tvPrice, item.getTicket_price());
    }
}
